<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>tl-ops-manage后台</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <script src="../lib/layui/layui.js" v="layui" e="layui"></script>
    <link rel="stylesheet" type="text/css" href="../lib/layui/css/layui.css" />
</head>
<style>
    .layui-form-pane .layui-form-label {
        width: 160px;
    }
    .layui-form-pane .layui-input-block {
        margin-left: 160px;
    }
    input {
        color: darkorchid;
        font-weight: 700;
    }
    .tl-ops-web-limit-form-span{
        margin-left: -15px;
        position: relative;
        top: 3px;
    }
    .tl-icon-font{
        border-radius: 23px;
        padding: 2px;
        font-size: 12px;
        background: burlywood;
        cursor: pointer;
    }
</style>
<body>

    <div class="layui-form layui-form-pane" lay-filter="tl-ops-web-limit-form" id="tl-ops-web-limit-form" style="padding: 20px 20px 0px 20px;">
        <div class="layui-form-item" style="display: none;">
            <label class="layui-form-label">服务名称</label>
            <div class="layui-input-block">
                <input type="text" name="service_name" class="layui-input" placeholder="请输入服务名称">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">熔断模式</label>
            <div class="layui-input-block" id="tl-tips-mode" onmouseleave="tl_mouse_leave_tips()"
                onmouseenter="tl_mouse_enter_tips('tl-tips-mode','熔断依据何种策略进行限流桶的扩缩容')">
                <input type="radio" name="mode" class="layui-input" value="balance_fail"><span class="tl-ops-web-limit-form-span">路由失败率</span>
                <input type="radio" name="mode" class="layui-input" value="health_state"><span class="tl-ops-web-limit-form-span">健康状态</span>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">自检层级</label>
            <div class="layui-input-block" id="tl-tips-level" onmouseleave="tl_mouse_leave_tips()"
                onmouseenter="tl_mouse_enter_tips('tl-tips-level','针对服务层级进行熔断限流')">
                <input type="radio" name="level" class="layui-input" value="service"><span class="tl-ops-web-limit-form-span">服务</span>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">依赖模式</label>
            <div class="layui-input-block" id="tl-tips-depend" onmouseleave="tl_mouse_leave_tips()"
                onmouseenter="tl_mouse_enter_tips('tl-tips-depend','依赖什么模式进行自检，点击切换将实时生效')">
                <input type="radio" name="depend" class="layui-input" value="token"><span class="tl-ops-web-limit-form-span">令牌桶</span>
                <input type="radio" name="depend" class="layui-input" value="leak"><span class="tl-ops-web-limit-form-span">漏桶</span>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">节点失败阈值</label>
            <div class="layui-input-block">
                <input type="number" name="node_threshold" class="layui-input" placeholder="请输入节点失败阈值"
                    id="tl-tips-node-threshold" onmouseleave="tl_mouse_leave_tips()"
                    onmouseenter="tl_mouse_enter_tips('tl-tips-node-threshold','节点达到某个失败阈值时，单个节点进行限流或熔断')">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">服务失败阈值</label>
            <div class="layui-input-block">
                <input type="number" name="service_threshold" class="layui-input" placeholder="请输入节点失败阈值"
                    id="tl-tips-service-threshold" onmouseleave="tl_mouse_leave_tips()"
                    onmouseenter="tl_mouse_enter_tips('tl-tips-service-threshold','服务节点失败率达到某个失败阈值时，单个服务进行限流或熔断')">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><i class="layui-icon layui-icon-help tl-icon-font" id="tl-tips-interval-help" onmouseleave="tl_mouse_leave_tips()"
                onmouseenter="tl_mouse_enter_tips('tl-tips-interval-help','该值修改后实时生效')"></i>  
                时间间隔 (ms)
            </label>
            <div class="layui-input-block">
                <input type="number" name="interval" class="layui-input"  placeholder="请输入时间间隔"
                    id="tl-tips-interval" onmouseleave="tl_mouse_leave_tips()"
                    onmouseenter="tl_mouse_enter_tips('tl-tips-interval','循环自检服务一个周期的时间间隔')">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">自动恢复时间 (ms)</label>
            <div class="layui-input-block">
                <input type="number" name="recover" class="layui-input"  placeholder="请输入自动恢复时间"
                    id="tl-tips-recover" onmouseleave="tl_mouse_leave_tips()"
                    onmouseenter="tl_mouse_enter_tips('tl-tips-recover','全面熔断后，服务自行恢复时间')">
            </div>
        </div>
        <div class="layui-form-item layui-hide">
            <input type="button" lay-submit lay-filter="tl-ops-web-limit-form-submit" id="tl-ops-web-limit-form-submit" value="确认">
        </div>
    </div>

    <script src="../lib/tl_ops_web_comm.js"></script>
    <script>
        layui.use(['table', 'form'], function () {
            window.form = layui.form;
            window.layedit = layui.layedit;
            window.tl_ops_web_limit_form_render = function(data){
                form.val("tl-ops-web-limit-form", Object.assign(form.val("tl-ops-web-limit-form"), data))
                form.render()
            }
        })
    </script>
</body>

</html>